#方法一
for i in range(1,10):
    for j in range(1,i+1):
        print(j,'*',i,'=',i*j,end='\t')
        #print( '%d * %d = %2d' % (j ,i,i*j) ,end = '\t' )
    print()


#方法二:
i = 1
while i < 10:
    j = 1
    while j < i+1:
        print(j,'*',i,'=',i*j,end='\t')
        j += 1
    i += 1
    print()

#方法三
i = 1
while i < 10:
    for j in  range(1,i+1):
        print(j,'*',i,'=',i*j,end='\t')
    print()
    i += 1

#方法四
for i,j in [(i,j) for i in range(1,10) for j in range(1,i+1)]:
    print(j,'*',i,'=',i*j,end='\t')
    if j==i:print()


print('\n'.join([' '.join(['%s * %s = %-2s\t' % (y,x,x*y) for y in range(1,x+1)]) for x in range(1,10)]))



